﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="class-rooms.aspx.cs" Inherits="school_class_room" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script src="../include/js/form.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyContentTop" runat="Server">
    <h1>
        ClassRooms</h1>
    <h3>
        How many ClassRooms have in selected school?.</h3>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="bodyContent" runat="Server">
    <div class="elements_inner_wrapper">
        <div id="contentBody">
            <div class="section">
                <div class="seperator">
                </div>
                <fieldset class="formouter">
                    <table cellpadding="3" cellspacing="3" width="100%">
                        <tr>
                            <td colspan="2">
                                <div class="row_curved" id="divSchoolList" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlSchoolList.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="School Name" ID="Label2" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlSchoolList" OnSelectedIndexChanged="ddlSchoolList_SelectedIndexChanged"
                                                DataSourceID="odsSchoolProfileList" DataTextField="ListText" DataValueField="ListValue" />
                                            <asp:ObjectDataSource ID="odsSchoolProfileList" runat="server" DataObjectTypeName="SIS.ENT.Listing"
                                                DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList"
                                                TypeName="SIS.BLL.ListingManager" UpdateMethod="Save">
                                                <SelectParameters>
                                                    <asp:Parameter DefaultValue="1" Name="ListType" Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvSchoolList" ValidationGroup="ClassRoom" ControlToValidate="ddlSchoolList"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a school name.<br/>"></asp:RequiredFieldValidator>
                                            &nbsp;&nbsp;
                                            <asp:Button Visible="false" runat="server" ID="btnShowClassRoom" Text="Show" OnClick="btnShowClassRoom_Click" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divLocation" runat="server" title="Example:UCSM, MIT, YTU">
                                    <label for="<%=ddlLocation.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Location Name" ID="lblLocation" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:DropDownList AutoPostBack="True" runat="server" ID="ddlLocation" OnSelectedIndexChanged="ddlLocation_SelectedIndexChanged"
                                                DataSourceID="odsStandarLevel" DataTextField="LocationName" DataValueField="LocationKey"
                                                Style="height: 22px" />
                                            <asp:ObjectDataSource ID="odsStandarLevel" runat="server" OldValuesParameterFormatString="original_{0}"
                                                SelectMethod="GetList" TypeName="SIS.BLL.LocationTableManager">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                        Type="Int32" />
                                                </SelectParameters>
                                            </asp:ObjectDataSource>
                                            <asp:RequiredFieldValidator ID="rfvLocation" ValidationGroup="ClassRoom" ControlToValidate="ddlLocation"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage="<br/>Please select a standard level.<br/>"></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h2>
                                    Class Rooms Listing</h2>
                                <p>
                                    <asp:ObjectDataSource ID="odsClassRoom" runat="server" DataObjectTypeName="SIS.ENT.ClassRoomTable"
                                        DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList"
                                        TypeName="SIS.BLL.ClassRoomTableManager" UpdateMethod="Save">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="ddlSchoolList" Name="SchoolKey" PropertyName="SelectedValue"
                                                Type="Int32" />
                                            <asp:ControlParameter ControlID="ddlLocation" Name="LocationKey" PropertyName="SelectedValue"
                                                Type="Int32" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" valign="top">
                                <div>
                                    <asp:GridView ID="grvClassRoom" runat="server" AutoGenerateColumns="False" DataKeyNames="ClassRoomKey,SchoolKey,LocationKey"
                                        CellPadding="4" Width="650px" DataSourceID="odsClassRoom" ForeColor="#333333"
                                        GridLines="None" OnSelectedIndexChanged="grvClassRoom_SelectedIndexChanged">
                                        <RowStyle BackColor="#EFF3FB" />
                                        <Columns>
                                            <asp:BoundField DataField="ClassRoomKey" HeaderText="ClassRoomKey" InsertVisible="False"
                                                ReadOnly="True" SortExpression="ClassRoomKey" Visible="False" />
                                            <asp:BoundField DataField="SchoolKey" HeaderText="SchoolKey" SortExpression="SchoolKey"
                                                InsertVisible="False" ReadOnly="True" Visible="False" />
                                            <asp:BoundField DataField="LocationKey" HeaderText="LocationKey" SortExpression="LocationKey"
                                                InsertVisible="False" ReadOnly="True" Visible="False" />
                                            <asp:BoundField DataField="ClassRoomCode" HeaderText="Code" SortExpression="ClassRoomCode" />
                                            <asp:BoundField DataField="ClassRoomName" HeaderText="Name" SortExpression="ClassRoomName" />
                                            <asp:BoundField DataField="SeatNo" HeaderText="Seat No." SortExpression="SeatNo" />
                                            <asp:BoundField DataField="ModifiedDateTime" HeaderText="ModifiedDateTime" SortExpression="ModifiedDateTime" />
                                            <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                                        </Columns>
                                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                        <EmptyDataTemplate>
                                            Please add new standard level of selected school.
                                        </EmptyDataTemplate>
                                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <EditRowStyle BackColor="#2461BF" />
                                        <AlternatingRowStyle BackColor="White" />
                                    </asp:GridView>
                                    <asp:ValidationSummary ID="vsClassRoom" runat="server" ValidationGroup="ClassRoom"
                                        ShowSummary="True" HeaderText="Please complete all highlighted fields of the form. Thank you."
                                        CssClass="errorSummary" />
                                    <asp:Label Visible="false" runat="server" Text="-1" ID="lblSchoolKey" />
                                    <asp:Label Visible="false" runat="server" Text="-1" ID="lblLocationKey" />
                                    <asp:Label Visible="false" runat="server" Text="-1" ID="lblClassRoomKey" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <h2>
                                    Class Room Details
                                </h2>
                                <div class="row_curved" id="divSchoolShortName" runat="server" title="Example:1-CS-ENG, BEHS-8-MM, 2nd-DIP-MATH">
                                    <label for="<%=txtClassRoomCode.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Code" ID="lblLocationCode" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="220px" ID="txtClassRoomCode" MaxLength="50" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvClassRoomCode" ValidationGroup="ClassRoom" ControlToValidate="txtClassRoomCode"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divClassRoomName" runat="server" title="Example:First Year Class A, BEHS 10 Room A">
                                    <label for="<%=txtClassRoomName.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Name" ID="lblClassRoomName" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="220px" ID="txtClassRoomName" MaxLength="50" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvClassRoomName" ValidationGroup="ClassRoom" ControlToValidate="txtClassRoomName"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divRoomNo" runat="server" title="Example:10, RM-20, CLASS-101">
                                    <label for="<%=txtRoomNo.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Room No." ID="lblRoomNo" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="100px" ID="txtRoomNo" MaxLength="10" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvRoomNo" ValidationGroup="ClassRoom" ControlToValidate="txtRoomNo"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div1" runat="server" title="Example:01, 08, 101">
                                    <label for="<%=txtUnitNo.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Unit No." ID="lblUnitNo" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="100px" ID="txtUnitNo" MaxLength="10" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvUnitNo" ValidationGroup="ClassRoom" ControlToValidate="txtUnitNo"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div2" runat="server" title="Example:7, 8, 10">
                                    <label for="<%=txtLevelNo.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Level No." ID="lblLevelNo" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="100px" ID="txtLevelNo" MaxLength="10" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvLevelNo" ValidationGroup="ClassRoom" ControlToValidate="txtLevelNo"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div3" runat="server" title="Example:50, 60, 100">
                                    <label for="<%=txtNoOfSeats.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Seats #" ID="lblNoOfSeats" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="100px" ID="txtNoOfSeats" MaxLength="10" runat="server" />
                                            <asp:RequiredFieldValidator ID="rfvNoOfSeats" ValidationGroup="ClassRoom" ControlToValidate="txtNoOfSeats"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="div4" runat="server" title="Example:Only for BEHS 10. Not avialble now.">
                                    <label for="<%=txtRemark.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Remark" ID="Label3" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:TextBox Width="270px" Rows="5" Columns="50" ID="txtRemark" MaxLength="255" runat="server" />
                                            <%--<asp:RequiredFieldValidator ID="rfvRemark" ValidationGroup="ClassRoom" ControlToValidate="txtRemark"
                                                runat="server" CssClass="validationErrorControl" Display="Dynamic" ErrorMessage=""></asp:RequiredFieldValidator>--%>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <%--<div class="row_curved" id="divOtherSchoolName" runat="server">
                                    <label for="<%=chkStatus.ClientID%>" class="mand_red">
                                        <asp:Label runat="server" Text="Status" ID="lblStatus" /></label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:CheckBox ID="chkStatus" runat="server" Text="" Checked="true" />
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>--%>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div class="row_curved" style="background-color: #efefef;" id="divButton" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Button ID="btnSubmit" CssClass="button_normal_submit" Text="Save" ValidationGroup="ClassRoom"
                                                OnClientClick="SubmitOnClientClick(this, 'ClassRoom');" runat="server" OnClick="btnSubmit_Click" /></span>
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnAddNewSchool" Text="New" OnClick="btnAddNew_Click"
                                            Style="height: 26px" />
                                        &nbsp;&nbsp;<asp:Button runat="server" ID="btnDelete" OnClientClick="return confirm('Are you sure to delete?');"
                                            Text="Delete" OnClick="btnDelete_Click" />
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="row_curved" id="divMessage" runat="server">
                                    <label>
                                        &nbsp;</label>
                                    <div class="field">
                                        <span class="indicator">
                                            <asp:Label ID="lblMessage" Font-Bold="true" runat="server"></asp:Label>
                                        </span>
                                    </div>
                                    <div class="clear">
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        //<![CDATA[
        SetSumitNormalButtonAttribute(document.getElementById('<%=btnSubmit.ClientID%>'));
        //]]>
    </script>

</asp:Content>
